<script setup lang="ts">
import { onMounted, ref } from "vue"
import { RouterView } from 'vue-router'
import { useCounterStore } from './stores/counter'
const userInfo = ref<any>(null)
const store = useCounterStore()
onMounted(() => {
  if (localStorage.getItem('userInfo')) {
    userInfo.value = JSON.parse(`${localStorage.getItem('userInfo')}`)
  }
  store.getUserInfo(userInfo.value)
  // console.log(userInfo.value);

  // console.log(JSON.parse(`${localStorage.getItem('books')}`));
  // console.log(localStorage.getItem('read-mode'));
  // localStorage.removeItem('comment')
  // localStorage.removeItem('chapter-buy')
  // console.log(JSON.parse(localStorage.getItem('comment')));

})
</script>

<template>

  <div>
    <Transition name="fade">
      <RouterView />
    </Transition>
  </div>

</template>

<style>
#app {
  padding: 0;
  overflow: auto;
}

.van-list__finished-text {
  text-align: center;
}

.fade-leave-from {
  transform: translateY(0);
}

.fade-leave-to {
  transform: translateY(-100vh);
}

.fade-leave-active {
  transition: all 0.2s;
}
</style>
